<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-category_id" data-rule="required" class="form-control selectpicker" name="row[category_id]">
                {foreach name="parentList" item="vo"}
                <option value="{$vo.id}" {$vo.pid == 0?'disabled':null} value="$row.category_id"}selected{/in}>{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('运营规则')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-freight_id" data-rule="required" data-source="single/freight/index" class="form-control selectpage" name="row[freight_id]" type="text" value="{$row.freight_id|htmlentities}">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Recommend_image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-recommend_image" class="form-control" size="50" name="row[recommend_image]" type="text" value="{$row.recommend_image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-recommend_image" class="btn btn-danger faupload" data-input-id="c-recommend_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-recommend_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-recommend_image" class="btn btn-primary fachoose" data-input-id="c-recommend_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-recommend_image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-recommend_image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Slider_images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-slider_images" data-rule="required" class="form-control" size="50" name="row[slider_images]" type="textarea" value="{$row.slider_images|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-slider_images" class="btn btn-danger faupload" data-input-id="c-slider_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-slider_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-slider_images" class="btn btn-primary fachoose" data-input-id="c-slider_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-slider_images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-slider_images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ot_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-ot_price" data-rule="required" class="form-control" step="0.01" name="row[ot_price]" type="number" value="{$row.ot_price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Unit')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-unit" data-rule="required" class="form-control" name="row[unit]" type="text" value="{$row.unit|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weight')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weight" class="form-control" data-rule="required" name="row[weight]" type="text" value="{$row.weight|htmlentities}">
        </div>
    </div>

    <div class="form-group row">
        <label class="control-label col-xs-12 col-sm-2">{:__('产品参数')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table  fieldlist" data-rule="required" data-template="typetpl" data-name="row[param_json]" id="first-table">
                <tr>
                    <td>{:__('名称')}</td>
                    <td>{:__('Value')}</td>
                    <td width="100"></td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[param_json]" class="form-control" cols="30" rows="5" style="display:none">{$row.param_json|htmlentities}</textarea>
            <script id="typetpl" type="text/html">
                <tr class="form-inline">
                    <td><input type="text" data-rule="required" name="<%=name%>[<%=index%>][title]" class="form-control" maxlength="4" size="15" value="<%=row.title%>"/></td>
                    <td><input type="text" data-rule="required" name="<%=name%>[<%=index%>][name]" class="form-control" size="15" maxlength="4" value="<%=row.name%>"/></td>
                    <td>
                        <!--下面的两个按钮务必保留-->
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_recommend')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_recommend" data-rule="required" class="form-control selectpicker" name="row[is_recommend]">
                {foreach name="isRecommendList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.is_recommend"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_hot')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_hot" data-rule="required" class="form-control selectpicker" name="row[is_hot]">
                {foreach name="isHotList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.is_hot"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_new')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_new" data-rule="required" class="form-control selectpicker" name="row[is_new]">
                {foreach name="isNewList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.is_new"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
